package com.smart.lib.controller;

import com.smart.lib.entity.BookInfo;
import com.smart.lib.service.LLMService;
import com.smart.lib.util.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * AI功能API
 * */
@RestController
@CrossOrigin
@RequestMapping("/ai")
public class LLMController {
    @Autowired
    LLMService llmService;

    /**
     * LLM根据语义提取关键字并进行查询
     * */
    @RequestMapping(value = "/getBookInfoByAIAnalysis",method = RequestMethod.POST,produces = "application/json; utf-8")
    public Response getBookInfoByAIAnalysis(@RequestBody BookInfo bookInfo){
        return llmService.getBookInfoByAI(bookInfo);
    }
}
